<?php

namespace app\user\validate;

use think\Validate;

class User extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
	    'mobile'=>'require|length:11|token',
        'mobile'=>'require|length:11',
        'password'=>'require|length:6,12',
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [
        'mobile.require'=>"手机号不能为空",
        'mobile.length'=>"手机号长度必须是11位",
        'password.require'=>"密码不能为空",
        'password.length'=>"密码长度必须是6~12位",
    ];
}
